const Router = require('koa-router')
const commentRouter = new Router({prefix:'/comment'})
const {
  verifyAuth,
  verifyPermission
} = require('../middleware/auth.middleware')
const {
  create,
  replay,
  update,
  remove,
  list
} = require('../controller/comment.controller')

commentRouter.post('/', verifyAuth, create)
commentRouter.post('/:commentId/replay',verifyAuth, replay)

commentRouter.patch('/:commentId', verifyAuth,verifyPermission('comment'),update)
commentRouter.delete('/:commentId', verifyAuth,verifyPermission('comment'),remove)
commentRouter.get('/',list)
module.exports =  commentRouter